package org.example.design.designmode.singleton;

/**
 * @Auther: lingshi
 * @Date: 2020/5/10 20:40
 * @Description:
 */
public class ThreadLocalSingleton {

    private static  final  ThreadLocal<ThreadLocalSingleton> st = new ThreadLocal<ThreadLocalSingleton>(){
        @Override
        protected ThreadLocalSingleton initialValue() {
            return new ThreadLocalSingleton();
        }
    };
    private ThreadLocalSingleton(){}

    public static ThreadLocalSingleton getInstance(){
        return st.get();
    }

}
